package com.free.mini.core.server.api;

import com.free.mini.core.server.vo.req.AdminUserQueryDetailReqVO;
import com.free.mini.core.server.vo.resp.AdminUserLoginRespVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;

import com.free.mini.common.base.ResultData;
import com.free.mini.core.server.config.CoreServerFeignConfiguration;
import com.free.mini.core.server.vo.req.AdminUserLoginReqVO;
import com.free.mini.core.server.vo.req.AdminUserRegisterReqVO;
import com.free.mini.core.server.vo.resp.AdminUserQueryDetailRespVO;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author dongsufeng
 * @version 4.0
 * @date 2023/8/19 12:53
 */
@FeignClient(name = "adminUserApi",url = "${feign.core.server.url:http://101.43.170.244:8083}", configuration = CoreServerFeignConfiguration.class)
public interface AdminUserApi {

    /**
     * 注册
     * @param reqVO req
     * @return true
     */
    @PostMapping("admin/user/v1/register")
    ResultData<Boolean> register(@RequestBody @Validated AdminUserRegisterReqVO reqVO);

    /**
     * 登录
     * @param reqVO req
     * @return token
     */
    @PostMapping("admin/user/v1/login")
    ResultData<AdminUserLoginRespVO> login(@RequestBody @Validated AdminUserLoginReqVO reqVO);

    /**
     * 按用户名查询
     * @return 详情
     */
    @PostMapping("admin/user/v1/detail")
    ResultData<AdminUserQueryDetailRespVO> detail(@RequestBody @Validated AdminUserQueryDetailReqVO reqVO);

}
